package Mybatis.dao;

import Mybatis.model.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface IUserDao {
    @Select("select * from users")
    List<User> findAll();

    @Insert("insert into users values(#{user.id},#{user.name},#{user.sex},#{user.address},#{user.birthday})")
    int save(User user);

    @Update("update users set name = #{name},address = #{address} where id = #{id} ")
    int update(@Param("name") String name,@Param("address") String address,@Param("id") int id);

    @Delete("delete from users where id = #{id}")
    int delete(@Param("id") Integer id);
}
